home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp95 / irinterf.doc < prev    next >
Internet Message Format  |  1995-03-31  |  26KB

  1. Path: funic!news.funet.fi!sunic!mcsun!uunet!zaphod.mps.ohio-state.edu!ncar!csn!news
  2. From: frechett@boulder.Colorado.EDU (-=Runaway Daemon=-)
  3. Newsgroups: comp.sys.handhelds
  4. Subject: I/O on the hp48sx
  5. Summary: Copy of HP 48 I/O Technical INterfacing Guide
  6. Keywords: I/O serial IR
  7. Message-ID: <1991Jan10.081920.19016@csn.org>
  8. Date: 10 Jan 91 08:19:20 GMT
  9. Sender: news@csn.org
  10. Reply-To: frechett@snoopy.Colorado.EDU (-=Runaway Daemon=-)
  11. Organization: University of Colorado, Boulder
  12. Lines: 575
  13. Nntp-Posting-Host: snoopy.colorado.edu
  14.  
  15.  
  16. Well, here it is.  I am sure that a few of you would really like to know
  17. just how in the hell the I/O on the hp48sx really works.  Well, for all you 
  18. people who can't access the hpbbs and request a hardcopy of this document from
  19. the sysop, here is the HP 48 I/O Technical Interfacing Guide
  20. presented with permission in plain ASCII format.  I have found this guide 
  21. extremely interesting and valuable.  Read the part about leaving the 
  22. IO port open. ;)  Two things I should say first.  
  23. 1. There are NO other guides like this.. Or at least not right now. Don't ask.
  24. 2. Any errors found in my typing are purely in your imagination, as I don't 
  25. make mistakes.  ;)  Seriously though, if you find any errors, tell me so that I
  26. can keep this updated.  I will indoubtably put a copy on wuarchive.wustl.edu
  27. at some point to keep all the ftp nuts happy.  
  28. Have fun with it.  
  29.  
  30.     ian          -=Runaway Daemon=-
  31.  
  32. P.S.  Got my 128K CMT SRAM card today.  I love it already. 
  33.  
  34.  
  35. ------------------------------------------------------------------------------
  36.  
  37.  
  38.  
  39.             HP 48 I/O
  40.                 TECHNICAL INTERFACING GUIDE
  41.  
  42.  
  43.          copyright Hewlett_Packard Company 1990
  44.                    All Rights reserved.
  45.                       June 14, 1990
  46.  
  47.  
  48.  
  49.                          CONTENTS
  50.  
  51. 1. Introduction  . . . . . . . . . . . . . . . . . . . . . . . . 1
  52.  
  53. 2. Wired Serial I/O Hardware . . . . . . . . . . . . . . . . . . 1
  54.    2.1 Cable Wiring. . . . . . . . . . . . . . . . . . . . . . . 1
  55.    2.2 Serial Format . . . . . . . . . . . . . . . . . . . . . . 3
  56.    2.3 Serial Electrical Specifications  . . . . . . . . . . . . 3
  57.    2.4 Serial UART Operation . . . . . . . . . . . . . . . . . . 4
  58.  
  59. 3. Infrared I/O Hardware . . . . . . . . . . . . . . . . . . . . 5
  60.    3.1 IR Format . . . . . . . . . . . . . . . . . . . . . . . . 5
  61.    3.2 Transmit and Receive Circuits . . . . . . . . . . . . . . 6
  62.    3.3 IR Specifications and Receive Circuits. . . . . . . . . . 7
  63.    3.4 IR UART Operation . . . . . . . . . . . . . . . . . . . . 8
  64.  
  65. 4. Kermit File Transfer. . . . . . . . . . . . . . . . . . . . . 8
  66.  
  67. 5. Non-Kermit I/O. . . . . . . . . . . . . . . . . . . . . . . . 9
  68.    5.1 General Considerations. . . . . . . . . . . . . . . . . . 9
  69.    5.2 Special Considerations for IR . . . . . . . . . . . . . . 9 
  70.  
  71.  
  72. #Daemon's note.  Page numbers are at end of pages.
  73.  
  74.  
  75.  
  76.  
  77.  
  78.                                - i -
  79.  
  80.  
  81.  
  82. 1.  Introduction
  83.  
  84. This document gives HP 48 hardware information required to connect serial
  85. devices to the wired (serial) I/O port or to communicate with the HP 48 via the
  86. 2-way infrared (IR) I/O port.  It also gives some consideration for I/O
  87. software on devices connected to the HP 48, and should be read in conjunction
  88. with "HP 48 I/O SOFTWARE INTERFACING GUIDE" which gives suggestions for
  89. programming the HP 48.  The serial I/O port is a full-duplex UART with RS-232
  90. compatible signal level shifting.  The IR I/O port uses an infrared receiver
  91. circuit for input and and LED for output, giving a half-duplex IR UART.  For
  92. both serial and IR ports, incoming bytes are received in the interrupted system
  93. (when the port is open) up to 255 byte limit of the input buffer.  
  94.  
  95. While every effort has been made to insure the accuracy of the information
  96. contained herein, this document and any examples contained herein are provided
  97. "as is" and are subject to the change without notice.  Hewlett-Packard makes no
  98. warranty of and kind with regard to this document, including, but not limited
  99. to, the implied warranties of merchantability and fitness for a particular
  100. purpose.  Hewlett-Packard Company shall not be liable for any errors of for
  101. incidental of consequential damages in connection with the furnishing,
  102. performance, or use of this document of the examples herein.
  103.  
  104. 2. Wired Serial I/O Hardware
  105.  
  106. The serial I/O port allows full-duplex communication between systems at 1200,
  107. 2400, 4800, or 9600 baud over wires with RS-232 compatible signal levels.
  108. Available parity settings are: none, odd, even, mark, or space.  Parity
  109. checking of received bytes may be disabled while still transmitting with parity.
  110. XON/XOFF handshaking can be used on either of both transmit and receive.  The
  111. serial I/O port is divided into separate receive and transmit sections which
  112. share a baud-rate-generator and and interrupt mechanism.  Both the receiver and
  113. transmitter sections are double-buffered to maximize the throughput of the
  114. serial channel. 
  115.  
  116. 2.1 Cable Wiring
  117.  
  118. The pin definitions for the HP 82208A (IBM) and 82209A (Macintosh) serial 
  119. cables for the HP 48 are shown on the next page, including the 25 pin end of
  120. the 9-25 pin adapter.  All signals are labeled from the HP 48's point of view.
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                - 1 -
  129.  
  130.  
  131. HP 48 I/O Cable Pinouts
  132.                                    ______________
  133. Macintosh end of cable            |   -   -   -  |
  134.                 5 -- RX (input)---|--V   V-------| 4 -- Signal GND
  135.                                   |  -   -     - |
  136.                                   |            ^-|--3 TX (output)
  137.                                   \    -    -    /
  138.                                    ----______----
  139.  
  140.  
  141. PC end of cable with 
  142. 9-25 adapter            /------------------7 Signal GND
  143.                         |       /----------3 TX (output)
  144.                         |       | /--------2 RX (input) 
  145.            13           V       V V V------1 SHIELD
  146.            ___________________________ 
  147.           \ O O O O O O O O O O O O O /
  148.            \ O O O O O O O O O O O O /
  149.              -----------------------
  150.             25                     14
  151.  
  152.  
  153.  
  154. PC end of cable   
  155.                    /--------------5 Signal GND
  156.                    |   /----------3 RX (input)
  157.                    |   | /--------2 TX (output)
  158.                    V   V V 1
  159.                  _____________
  160.                  \ O O O O O /
  161.                   \ O O O O /
  162.                     -------
  163.                     9     6
  164.  
  165.  
  166. Notes:
  167. 1. Output = from HP 48     _________
  168. s. Input  = to HP48       | o o o o |
  169.                            \_______/
  170.                             ^ ^ ^ ^
  171.                             | | | \------ 1 SHIELD
  172.                             | | \---------2 TX (output)
  173.                             | \-----------3 RX (input)
  174.                             \-------------4 Signal GND
  175.  
  176.  
  177.  
  178.  
  179.  
  180.                            - 2 -
  181.  
  182.  
  183.  
  184. 2.2 Serial Format
  185.  
  186. A frame of serial data consists of a start bit, eight data bits, and at least
  187. one stop bit.  The start bit is equivalent to a "0" data bit and a stop bit is
  188. equivalent to a "1" data bit.  The data bits are sent least-significant-bit
  189. first.  The HP 48 transmitter sends slightly more than 2 stop bits with every
  190. frame.  The HP 48 receiver requires at least 1 stop bit for proper frame
  191. synchronization. 
  192.  
  193. A mark condition or "1" data bit on the serial line corresponds to a negative
  194. voltage.  A space condition or "0" data bit corresponds to a positive voltage.
  195. an idle corresponds to zero voltage.  The line is held in this low power (idle)
  196. state when the port is closed.  when the port is open, the line is normally
  197. held in the mark condition.  When data is to be transmitted it must start in
  198. the mark condition.  When the line is to be returned to the idle condition is
  199. must pass through the mark condition first.  
  200.  
  201. A break condition is when the line is held in the space condition for at least
  202. one entire frame. A break should not start in the middle of a character.
  203.  
  204. 2.2.1  Example: an 'H' (48hex)
  205.                      0     0     0     1     0     0     1     0 
  206.             |  .  |  .  |  .  |  .  |  .  |  .  |  .  |  .  |  .  |  .  |  .  |
  207. SPACE +V     _______________________       ___________       _____
  208.             |                       |     |           |     |     |
  209. SIGNAL GND -|- - - - - - - - - - - -|- - -|- - - - - -|- - -|- - -|- - - - - -
  210.             |                       |     |           |     |     |
  211. MARK  -V ---      LSB                -----             ----- MSB   -----------
  212.             |<--->|<--------------------------------------------->|<--------->|
  213.              START               DATA BITS                           STOP
  214.               BIT   
  215.  
  216. 2.3 Serial Electrical Specifications 
  217.  
  218. The following table gives the port electrical operating specifications.  The TX
  219. output voltage swing is measured at the end of a 1-meter cable with the
  220. specified load, where the 500 pF includes distributed capacitance in the cable.
  221.  
  222.  ___________________________________________________________________________
  223. | Signal |           Description                  | Min | Typ | Max | Units |
  224. |===========================================================================|
  225. |        |Out V swing. Load 3KOhm min, 500 pF max |+-3.0| 3.5 |     |       |
  226. |   TX   |----------------------------------------|-----|-----|-----|-------|
  227. |        | Bit width tolerance                    |     |     | 2.5 |  %    |
  228. |--------|----------------------------------------|-----|-----|-----|-------|
  229. |        | Input + operating range                | 1.0 |     |15.0 |  V    |
  230. |        |----------------------------------------|-----|-----|-----|-------|
  231. |        | Input - operating range                |-15.0|     |0.3  |  V    |
  232. |   RX   |----------------------------------------|-----|-----|-----|-------|
  233. |        | Input impedance                        | 5.0 |     | 7.0 | KOhms |
  234. |        |----------------------------------------|-----|-----|-----|-------|
  235. |        | Bit width tolerance                    |     |     | 2.5 |  %    |
  236. |--------|----------------------------------------|-----|-----|-----|-------|
  237. | All    | Absolute maximum voltage              |     |     |+-25 |  V    |
  238.  ---------------------------------------------------------------------------
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.                                - 3 -
  246. 2.4 Serial UART Operation
  247.  
  248. 2.4.1 Receiver Operation
  249.  
  250. Port must be open to receive data.  HP 48 Kermit I/O functions, XMIT, and SRECV
  251. all open the port automatically if it is closed.  The following description fo
  252. the HP 48 receiver is offered as a model for the receiver on and external
  253. device communicating with the 48.
  254.  
  255. All bit timing is relative to the leading-edge of the start bit.  The
  256. resolution of this timing is 16 times the baud setting.  The data on the RX
  257. pin is shifted into a shift register at the center of the bit time.  When the
  258. RX pin goes to the space condition (indicating the start of a frame) the
  259. receive clock starts.  If the RX pin remains in the space condition for at
  260. least half a bit time, the start bit is considered valid and the receive shift
  261. register is enabled.  If the RX pin returns to mark condition before a half bit
  262. time elapses, the receive clock stopped and the frame aborted.
  263.  
  264. When the shift register has shifted in a start bit, eight data bits, and a stop
  265. bit, it transfers the eight data bits to the receive buffer register (RBR),
  266. sets the receive buffer full flag (RBF), and reinitializes the shift register.
  267. If the RBF flag was already set, the receive error (RER) flag is set to
  268. indicate an overrun.  If the stop bit was not a "1" (mark condition), the RER
  269. flag is set to indicate a framing error.  Then the receiver returns to its idle
  270. state of waiting for a valid start bit.  Another incoming frame may be received
  271. while software is responding to the RBF condition.  
  272.  
  273. The HP 48 software reads the byte out of the RBR and places the bytes in a 255
  274. byte input buffer.  All parity checking is done in software when the bytes are
  275. read out of this input buffer.  
  276.  
  277. 2.4.2 Interpretation of Break Condition
  278.  
  279. a break condition on the line will be interpreted as a valid start bit followed
  280. by eight zero data-bits and at least one "0" (invalid) stop-bit.  Thus a break
  281. condition will result in a null byte in RBR and setting RER and RBF.  The start
  282. bit filter will prevent an extended break condition from being interpreted as
  283. additional characters until the line returns to the mark condition. 
  284.  
  285. 2.4.3 Transmitter Operation
  286.  
  287. When the port is closed, the transmit voltage level shifter is turned off to
  288. save power.  The TX pin is shorted to signal ground to send a line idle
  289. condition.  When the port is opened, the transmit level shifter is enabled and
  290. the TX pin goes to the mark condition.  For each data byte of data, the
  291. transmitter sends 2 stop bits, 1 start bit, and 8 data bits plus 3/16 bit
  292. internal clocking delay for a total of 11.375 bits per frame.  Therefore the
  293. maximum transmission rate is:
  294.  
  295.      Baud setting/11.375   (844 characters/second at 9600 baud)
  296.  
  297.  
  298.  
  299.                               - 4 -
  300.  
  301. 3. Infrared I/O Hardware
  302.  
  303. The IR port allows half-duplex communications between systems at 2400 baud
  304. using pulses of infrared light instead of wires.  Full-duplex is not used due
  305. to the need to suppress reflections.  
  306.  
  307. 3.1 IR Format
  308.  
  309. The format for IR transmission is similar to serial transmission except a
  310. pulse of infrared light of 52 us duration (nominal) is used to transmit a
  311. zero-bit.  the absence of a pulse indicates a one-bit or idle condition.  Note
  312. that if the pulses are stretched out to fill a bit time this becomes very
  313. similar to the serial signal.
  314.  
  315. 3.1.1 Example: an 'H' (48 hex)
  316.  
  317.  
  318.  
  319.                |           |              |               |
  320.                                            ___
  321.                                           |   |
  322.                -------------              |   '------------
  323.  
  324.                                           |<->| 52 us
  325.                |<--------->|              |<------------->|
  326.                | 416.7 us  |              |   416.7 us    | 
  327.                \_____      |              |     __________/
  328.                      \     |              |    /
  329.                       |    |              |    |
  330.           0    0    0    1    0    0    1    0
  331.   |    |    |    |    |    |    |    |    |    |    |    |  
  332.  
  333.   #    #    #    #         #    #         #
  334.   #    #    #    #         #    #         #
  335.   #    #    #    #         #    #         #
  336. -- ---- ---- ---- --------- ---- --------- -------------------
  337.   |    | LSB                                MSB|         |
  338.   |<-->|<-------------------------------->|<------------>|
  339.    START       DATA BITS                      STOP
  340.     BIT                                       BITS
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.                            - 5 -
  354.  
  355.  
  356. 3.2 Transmit and Receive Circuits
  357.  
  358. The first circuit shown below detects incoming IR pulses and produces the
  359. signal shown at the left, labeled "IN".  The second circuit generates the IR
  360. output given the signal shown at the left, labeled "OUT".
  361.  
  362. Receive Circuit.
  363.                             +5V
  364.                 _________________________________________________
  365.                |                           |                     |
  366.         10K    \                      18K  \               1M    \
  367.         1/8 W  / R6                   1/8W /  R8           1/8W  /  R7
  368.                \                           \                     \
  369. ---------------|                           |                     |
  370.                |                            \                    |
  371.                |                             \|                  |
  372.                 \                        Q4   |------------------|
  373.                  \|           R4             /|                  |
  374.              Q3   |----------/\/\/----------V    <---,           |
  375.                  /|     |   220K            |       '-----       |
  376.                 V       |   1/8 W           |                    |
  377.   +5V _  ____   |       |                   |                    |
  378.        ||       | 560K  /  R5        220K   /                    |
  379.        ||       | 1/8W  \            1/8W   \  R3                /
  380.   GND  --       |       /                   /                  |/
  381.                 |       |                   |------------------|  Q2
  382.                 |       |                   |                  |\
  383.                 |       |           .022uF ---  C1               V
  384.                 |       |                  ___                   |
  385.                 |       |                   |                    |
  386.                  ---------------------------|--------------------
  387.                                          ---|---
  388.                                           --|--
  389.                                             -
  390.  
  391.                           +5V
  392.                           ---
  393.       Transmit Circuit     |
  394.                 39Ohms     /
  395.                 1/8W       \  R1         Q1,Q2,Q3:  2N3904
  396.      +5V   __              /             Q4: EG&G VATEC VTT 9112
  397.            ||              |             CR1: NEC SE303A
  398.            ||            -----  --,           or
  399.    GND    -  -----  CR1   \ /    '-->         HP HEMP-3301 (narrower beam)
  400.                           ---
  401.                            |             R1-R8: 5%
  402.                            /
  403. OUT            R2        |/
  404. --------------\/\/\------| Q1
  405. ---->         500 Ohms   |\
  406.               1/8 W        V
  407.                          -----
  408.                           ---
  409.                            -
  410.  
  411.  
  412.  
  413.  
  414.  
  415.                              - 6 -
  416.  
  417.  
  418. 3.3 IR Specifications
  419.  
  420.  _______________________________________________________________________
  421. |     Description                       |  Min  |  Typ  |  Max  | Units | 
  422. |=======================================================================|
  423. | Wavelength                            |       |  940  |       |  nm   |
  424. |---------------------------------------|-------|-------|-------|-------|
  425. | Distance from transmitter to receiver |       |       |  2.0  |  in   |
  426. |---------------------------------------|-------|-------|-------|-------|
  427. | Half intensity beam width             | +-20  | +-30  |       |       |
  428. |---------------------------------------|-------|-------|-------|-------|
  429. | Receiver pulse width                  |  40   |  52   |   80  |  us   |
  430. |---------------------------------------|-------|-------|-------|-------|
  431. | Transmitter pulse width               |  46.8 |  52   |  57.2 |  us   |
  432. |---------------------------------------|-------|-------|-------|-------|
  433. | Baud                                  | 2340  | 2400  | 2460  | bit/s |
  434.  -----------------------------------------------------------------------
  435.  
  436. 1. Half intensity beam width is measured from the emitter's centerline to where
  437.    the radiant intensity is half the on-axis value.
  438.  
  439. 2. The IR transparent material used in the HP 48 card cover is GE ML4309-21051
  440.    IR TRANSPARENT FCR POLYCARBONATE.
  441.  
  442. Not to scale.
  443.                               ___________   ____________________
  444.                                |           |
  445.                                |           |       _____________
  446.                                |           |       |
  447.                                |           |       |
  448.                                |           |       |
  449.                        3.200 in            |       |
  450.                         81.3 mm            |       | Centerline
  451.                         - - - - - - - - - -|- - - -|- - - - - -  
  452.                                 ^   ^ .293 in 
  453.                            .532 in  v  7.4 mm
  454.                                 |   --------- (LED)|
  455.                            13.5 mm  ^ .238 in      |
  456.                                 v   v  6.0 mm      |
  457.                         --------------------- (###)| Phototransistor
  458.                                |           |       |_____________
  459. ALL DIMENSIONS ARE NOMINAL     |           |       
  460.                               -----------   ---------------------        
  461.  
  462. (neat picture of end of calc from end deleted)
  463.         serial     v-----LED (CR1)
  464.          oooo      O O
  465.                      ^---Phototransistor (Q4)
  466.  
  467. (neat picture of end of calc from side deleted)
  468. Calc is 1.085 in (27.6 mm) high.
  469. IR is 0.625 in (15.9 mm) high. 
  470. IR is slanted 10 degrees down from level.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.                               - 7 - 
  477.  
  478. 3.4 UART Operation
  479.  
  480. The UART uses the transmit and receive circuits for IR output and input as
  481. described below.
  482.  
  483. 3.4.1 Transmitter Operation
  484.  
  485. The port must be open to transmit data.  HP 48 Kermit I/O functions, XMIT, and
  486. SRECV all open the port automatically if it is closed.  The output of the UART
  487. is modulated under "IR Format" and send to the output circuit.
  488.  
  489. The serial port cannot be used while doing IR I/O.  It's TX pin will be held in
  490. the mark condition and breaks (SBRK command) will not be sent to the TX pin but
  491. will instead generate a series of IR pulses.  
  492.  
  493. 3.4.2 Receiver Operation
  494.  
  495. The port must be open to receive data.  HP 48 Kermit I/O functions, XMIT, and
  496. SRECV all open the port automatically if it is closed.  The following
  497. description of the HP 48 IR receiver is offered as a model for the receiver on
  498. and external device communicating with the 48.
  499.  
  500. IR pulses from the receive circuit's "IN" signal are used to set a latch whose
  501. output is called IRE (IR Event).  The receiver starts by waiting for a valid
  502. start bit.  and incoming pulse of IR will start the receiver clock, which
  503. shifts IRE into a shift register after half of a vit time and then clears IRE
  504. for the next bit.  Because this method stretchs the pulses, any pulse of light
  505. that is long enough to set IRE will be considered a valid start bit.  
  506.  
  507. The remaining bits are shifted in in the same fashion as described above for
  508. the wired UART including checking for framing and overrun errors and using RBR
  509. and RBF.  As in the serial port, all bit timing is relative to the leading edge
  510. of the start bit and has 1/16th bit resolution.  
  511.  
  512. Due to the probability that reflections from the transmitter will be received
  513. and interpreted by the receiver, the receiver data is ignored (by disabling
  514. receiver interrupts) while transmitting.
  515.  
  516. The serial port cannot be used while doing IR I/O.  Its RX pin will be ignored
  517. by the UART. 
  518.  
  519. 4. Kermit File Transfer
  520.  
  521. Kermit file transfer is preferable to unformated I/O since it can detect errors
  522. and correct them by re-transferring bad packets.   The Kermit you use should be
  523. set to use type 3 (CRC) checksums for IR I/O since the error rate is higher 
  524. than for wired I/O. If you use your Kermit in server mode the HP 48 will use
  525. "I" packets to request type checksums.
  526.  
  527. The HP 48 Kermit does not use XON/XOFF handshaking since Kermit packets are
  528. small enought that additional handshaking should not be necessary.  Your Kermit
  529. must have an input buffer which can hold at least 14 bytes in order to receive
  530. an "S" or "I" from the HP 48, although a larger buffer is clearly desirable for
  531. more efficient transfers.  The input buffer must also be large enough to
  532. receive the largest "F" (filename) packet that will be sent.
  533.  
  534.  
  535.  
  536.  
  537.                             - 8 -
  538.  
  539.  
  540.  
  541. 5.  Non-Kermit I/O
  542.  
  543. 5.1  General Considerations
  544.  
  545. The HP 48 can receive a maximum of 255 bytes in a continuous stream, so to
  546. transfer more than this you should use XON/XOFF handshaking or some higher
  547. level protocol which breaks the data stream into pieces smaller than this.
  548. Data sent to the HP 48 should have inter-frame gaps less than 4 frame times or
  549. greater than 4 frame times plus 5 ms.  Inter-frame gaps of between 4 frame
  550. times and 4 frame times plus 5 ms should be avoided since they may cause UART
  551. overruns on the HP 48.  Be sure the clock is not ticking in the HP 48 display
  552. since clock ticks, alarms coming due, or other timer interrupts extend the 5 ms
  553. to a much longer time, so they can cause UART overruns.  For the same reason,
  554. no keys should be pressed while doing I/O (unless the intent of the key press
  555. is to abort the I/O).  You must allow enough time for the HP 48 to read data
  556. out of its receive buffer (using SRECV) before sending more data or the 255
  557. byte receive buffer will be overflowed.  
  558.  
  559. Use of some sort of checksum is recommended, especially for IR I/O  which is
  560. sensitive to noise.  Garbage characters (most commonly FF  bytes) can be
  561. received between transmissions since a single IR or electrical noise pulse acts
  562. as a start bit.
  563.  
  564. 5.2 Special Considerations for IR
  565.  
  566. Since IR from the transmitter can reflect back into the receiver, the receiver
  567. should be ignored while transmitting and carefully cleaned up after the
  568. transmitting is done.  If your IR receive circuit is feeding a UART, you should
  569. wait for at least a half bit time after the stop bit from the last transmitted
  570. to be sure that reflected byte has been received before clearing the UART's
  571. receive buffer as well as any framing or overrun errors.  At this point the
  572. receive circuit will be ready to receive valid data, although (as noted above)
  573. this "valid data" can contain garbage characters due to IR or electrical noise
  574. pulses.  Be sure to use some reliable error detection technique if data
  575. integrity is important!
  576.  
  577. Because IR I/O half duplex (due to reflections), XON/XOFF handshaking is not
  578. possible.
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.                                - 9 -
  590.